<?php
	session_start();	
?>

<?php
	if( $_SESSION["admin"] != "" )
	{
?>
<a href="index.php?com=attribute"><b>List attribute</a></b> | <b><a href="index.php?com=attribute&func=add">Add new attribute</b></a>
<br />
<?php 
	include_once("process/attribute.php");
	$attribute = new attribute();
    if( isset($_POST['btnAdd']) )
	{		
			$ProductNo = stripcslashes($_POST["ProductNo"]);
    		$SKU=stripcslashes($_POST["SKU"]);
    		$Attribute1=stripcslashes($_POST["Attribute1"]);
            $Attribute2=stripcslashes($_POST["Attribute2"]);
            $Attribute3=stripcslashes($_POST["Attribute3"]);
            $Attribute4=stripcslashes($_POST["Attribute4"]);
            $Attribute5=stripcslashes($_POST["Attribute5"]);
            $Attribute6=stripcslashes($_POST["Attribute6"]);
            $Attribute7 = stripcslashes($_POST["Attribute7"]);
    		$Attribute8=stripcslashes($_POST["Attribute8"]);
    		$Attribute9=stripcslashes($_POST["Attribute9"]);
            $Attribute10=stripcslashes($_POST["Attribute10"]);
            $Price=stripcslashes($_POST["Price"]);
            $Cost=stripcslashes($_POST["Cost"]);
            $Quantity=stripcslashes($_POST["Quantity"]);
            $Unit=stripcslashes($_POST["Unit"]);
            $Weight = stripcslashes($_POST["Weight"]);
    		$Length=stripcslashes($_POST["Length"]);
    		$Height=stripcslashes($_POST["Height"]);
            $Width=stripcslashes($_POST["Width"]);
            $ContainerCode=stripcslashes($_POST["ContainerCode"]);
            $BillingInterval=stripcslashes($_POST["BillingInterval"]);
            $SubscriptionPeriod=stripcslashes($_POST["SubscriptionPeriod"]);
            $IntervalBegin=stripcslashes($_POST["IntervalBegin"]);
            $NewBillType=stripcslashes($_POST["NewBillType"]);
            $StartupFee=stripcslashes($_POST["StartupFee"]);
            $RenewUpdateInd=stripcslashes($_POST["RenewUpdateInd"]);
            $Isbn=stripcslashes($_POST["Isbn"]);
            $Mpn=stripcslashes($_POST["Mpn"]);
            $Upc=stripcslashes($_POST["Upc"]);
            $Condition=stripcslashes($_POST["Condition"]);
            $StoreQTY=stripcslashes($_POST["StoreQTY"]);
        //echo $code, $name, $order;
        if($ProductNo != "")
        {
    		$attribute->AddAttribute($ProductNo, $SKU, 
            $Attribute1, $Attribute2, $Attribute3, $Attribute4, $Attribute5, 
            $Attribute6, $Attribute7, $Attribute8, $Attribute9, $Attribute10, 
            $Price, $Cost, $Quantity, $Unit, $Weight, $Length, $Height, 
            $Width, $ContainerCode, $illingInterval, $SubscriptionPeriod, 
            $IntervalBegin, $NewBillType, $StartupFee, $RenewUpdateInd, $Isbn, 
            $Mpn, $Upc, $Condition, $StoreQTY);	
    	//	echo '<meta http-equiv="Refresh" content="0;URL=index.php?com=attribute" />';
    		//return;
        }
	}
?>

<form method="post" action="index.php?com=attribute&func=add" id="contactform" name="addcountry" onSubmit="return validateForm()">
	<table width="100%" style="font-size:10pt;">
		<tr>
			<td align="center" colspan="6" height="50"><b style="font-size:12pt; color:Blue;">Add new attribute</b></td>
		</tr>
		<tr style="font-weight:bold;">
			<td align="right">ProductNo :&nbsp;&nbsp;</td>
			<td>
				<input class="validate[required]" type="text" name="ProductNo" id="ProductNo" /><font style="color: red;"> *</font>
			</td>
            <td align="right">SKU :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="SKU" id="SKU" /><font style="color: red;"> *</font>
			</td>
            <td align="right">Attribute1 :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Attribute1" id="Attribute1" />
			</td>
		</tr>
        <tr style="font-weight:bold;">
			<td align="right">Attribute2 :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Attribute2" id="Attribute2" />
			</td>
            <td align="right">Attribute3 :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Attribute3" id="Attribute3" />
			</td>
            <td align="right">Attribute4 :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Attribute4" id="Attribute4" />
			</td>
		</tr>
        	<tr style="font-weight:bold;">
			<td align="right">Attribute5 :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Attribute5" id="Attribute5" />
			</td>
            <td align="right">Attribute56:&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Attribute6" id="Attribute6" />
			</td>
            <td align="right">Attribute7 :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Attribute7" id="Attribute7" />
			</td>
		</tr>
        <tr style="font-weight:bold;">
			<td align="right">Attribute8 :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Attribute8" id="Attribute8" />
			</td>
            <td align="right">Attribute9 :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Attribute9" id="Attribute9" />
			</td>
            <td align="right">Attribute10 :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Attribute10" id="Attribute10" />
			</td>
		</tr>
        <tr style="font-weight:bold;">
			<td align="right">Price :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Price" id="Price" />
			</td>
            <td align="right">Cost :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Cost" id="Cost" />
			</td>
            <td align="right">Quantity :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Quantity" id="Quantity" />
			</td>
		</tr>
       <tr style="font-weight:bold;">
			<td align="right">Unit :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Unit" id="Unit" />
			</td>
            <td align="right">Weight :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Weight" id="Weight" />
			</td>
            <td align="right">Length :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Length" id="Length" />
			</td>
		</tr>
        <tr style="font-weight:bold;">
			<td align="right">Height :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Height" id="Height" />
			</td>
            <td align="right">Width :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Width" id="Width" />
			</td>
            <td align="right">ContainerCode :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="ContainerCode" id="ContainerCode" />
			</td>
		</tr>
        <tr style="font-weight:bold;">
			<td align="right">BillingInterval :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="BillingInterval" id="BillingInterval" />
			</td>
            <td align="right">SubscriptionPeriod :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="SubscriptionPeriod" id="SubscriptionPeriod" />
			</td>
            <td align="right">IntervalBegin :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="IntervalBegin" id="IntervalBegin" />
			</td>
		</tr>
        <tr style="font-weight:bold;">
			<td align="right">NewBillType :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="NewBillType" id="NewBillType" />
			</td>
            <td align="right">StartupFee :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="StartupFee" id="StartupFee" />
			</td>
            <td align="right">RenewUpdateInd :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="RenewUpdateInd" id="RenewUpdateInd" />
			</td>
		</tr>
        <tr style="font-weight:bold;">
			<td align="right">Isbn :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Isbn" id="Isbn" />
			</td>
            <td align="right">Mpn :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Mpn" id="Mpn" />
			</td>
            <td align="right">Upc :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Upc" id="Upc" />
			</td>
		</tr>
        <tr style="font-weight:bold;">
			<td align="right">Condition :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="Condition" id="Condition" />
			</td>
            <td align="right">StoreQTY :&nbsp;&nbsp;</td>
			<td>
				<input type="text" name="StoreQTY" id="StoreQTY" />
			</td>
		</tr>
		<tr>
			<td></td>
			<td colspan="6" align="left" height="40">
				<input type="submit" name="btnAdd" id="btnAdd" value="Add"  />
				<input type="reset" value="Reset" />
			</td>
		</tr>
	</table>
</form>
<i>Please fill in these fields (<font style="color: red;">*</font>)</i>
<?php
  }
   else
	{
		echo "<meta http-equiv='refresh' content='0; url=login.php' />";
	}
?>